home *** CD-ROM | disk | FTP | other *** search
- On 20 Apr 1997, Stephen W Williams wrote:
-
- > To All
- > Can someone help me with a small but irritating problem I am having
- > with a little prog I am trying to get working.
- > What I want to do is use AmosPro to create a file in Ram called Datapath
- > and then execute it with Amiga dos.
- > If you look at the example below it should create a file called Datapath
- > containing "CD workbench:data".
- > Now the hard part, the file should change the current directory to
- > workbench:data (which does exist on my system).
- > But What I get is "object not found CD failed returncode 20",
- > I think I have found why it doesn't run because there seems to be extra
- > characters at the end of the file, I.e. the example below should create a file
- > 18 characters long including Return
- > But the actual file is 20 long and its these extra characters that cause the
- > problem, If I load the file into a Text Editor and delete the invisible
- > characters at the end and resave the file it runs fine.
- > So the Question how do I create a file without the extra characters?
- > I have tryed CHR$(13)/CHR$(10) After A$ but no luck.
- > And I can remove any extra characters easily inside Amos.
- >
- > a$="workbench:data"
- > C$="CD "
- > A$=C$+A$
- > Open Out 3,"Ram:Datapath"
- > Print #3,A$
- > Print #3,Chr$(13)
- > Close 3
- >
- > Any help would be appreciated
- > Thanks Steve.
- > end
-
- The way I see it the fault MUST lie in the EOL chars. AMOS writes CRLF
- EOLs, whereas AmigaDOS expects LF EOLS. So you might want to do the
- writing this way:
-
- Open Out 3,"ram:datapath"
- Print#3,A$;Chr$(10);
- Close 3
-
- Remember to ALWAYS use a semicolon (;) in Print# commands if you want
- to write AmigaDOS readable files!
-
- /----------------------------------------------------------------------\
- | Joona Palaste | | | |
- | palaste@cc.helsinki.fi | | | |
- | G++ FR FW+ M- #20 D+ ADA N+++ W++ B OP+ |------- -----------------|
- | |------- -----------------|
- | | | | |
- | Finland rules! => | | | |
- \----------------------------------------------------------------------/
-
-
-